﻿using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;

namespace TL_Cloud.ViewModels.BookShop.BaseGrade
{
    public class BaseGradeAddOrUpdateResourceValidator<T> : AbstractValidator<T>
          where T : BaseGradeBasicResource
    {
        public BaseGradeAddOrUpdateResourceValidator()
        {
            RuleFor(x => x.GradeName)
              .NotNull()
              .WithName("年级")
              .WithMessage("required|{PropertyName}是必填的")
              .MaximumLength(20)
              .WithMessage("maxlength|{PropertyName}的最大长度是{MaxLength}");

            //RuleFor(x => x.Body)
            //    .NotNull()
            //    .WithName("正文")
            //    .WithMessage("required|{{PropertyName}是必填的")
            //    .MinimumLength(100)
            //    .WithMessage("minlength|{PropertyName}的最小长度是{MinLength}");
        }
    }
    
}
